FROM golang:1.17 AS builder

ENV PORT=80 \
  GO111MODULE=off \	
  CGO_ENABLED=0 \
  GOOS=linux \	
  GOARCH=amd64

WORKDIR /build
COPY . .
RUN go build -o httpserver .

FROM scratch
COPY --from=builder /build/httpserver /
EXPOSE $PORT
ENTRYPOINT ["/httpserver"]